<?php 
if($form->hasErrors()){
	$err_mess="alert('";
	$errors=$form->getErrors();
	foreach($errors as $error){
		$err_mess.=$error[0].'\n';
	}
	$err_mess.="');";
	$cs=Yii::app()->clientScript;
	$cs->registerScript('login_error',$err_mess);
	$form->clearErrors();
}
?>
<?php $this->pageTitle=Yii::app()->name . ' - 登录'; ?>
<div id=back1>

<div class="yiiForm" style="margin-top:130px;margin-left:60px">
<?php
	echo EHtml::form();	
	EHtml::setOptions(array('errorElement'=> 'span',));		
?>

<div class="simple3">
<?php echo CHtml::activeLabel($form,'username'); ?>
<?php echo EHtml::activeTextField($form,'username') ?>
</div>

<div class="simple3">
<?php echo CHtml::activeLabel($form,'password'); ?>
<?php echo EHtml::activePasswordField($form,'password') ?>
</div>

<div class="action1"style="margin-left:315px">

<br/>
<?php echo EHtml::submitButton('登录'); ?>
</div>

<?php echo EHtml::endForm(); ?>

</div><!-- yiiForm -->
</div>